/**
 * Created by wenguangjia on 2017/8/31.
 */
(function () {
    'use strict';

    angular
        .module('logcenterApp')
        .controller('esStatusController', esStatusController);
    esStatusController.$inject = ['$scope', 'searchService', 'toaster','$sce'];
    function esStatusController($scope, searchService, toaster,$sce) {
        var notify = function (type, title, message) {
            toaster.pop(type, title, message);
        };


        searchService.queryCluster().then(function(resp){
            $scope.source=resp.data;
            $scope.clusterName = $scope.source[0].name;
            $scope.clusterAddr = $scope.source[0].statusAddr;
            $scope.src = $sce.trustAsResourceUrl($scope.clusterAddr);
        },function(error){});

        $scope.selectShow = function(item){
            $scope.win.close();
            $scope.clusterName = item.name;
            $scope.src = $sce.trustAsResourceUrl(item.statusAddr);
        }

    }


})();
